import logging
from redis import StrictRedis





class Config(object):


    LOG_LEVEL = logging.DEBUG


    #工程配置信息
    SECRET_KEY = "EjpNVSNQTyGi1VvWECj9TvC/+kq3oujee2kTfQUs8yCM6xX9Yjq52v54g+HVoknA"

    DEBUG = True

    SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@127.0.0.1:3306/information"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # redis配置
    REDIS_HOST = "192.168.145.128"

    REDIS_PORT = 6379

    SESSION_TYPE = "redis" # 指定session　保存到redis中
    SESSION_USE_SIGNER = True  # 让cookie 中的session_id　被加密签名处理
    SESSION_REDIS = StrictRedis(host=REDIS_HOST,port=REDIS_PORT)  #使用redis　的实例
    PERMANENT_SESSION_LIFETIME = 86400 #session 的有效期，单位是秒

class DevelopementConfig(Config):

    DEBUG = True

class ProductionConfig(Config):


    DEBUG = False

config = {
    'devlopment':DevelopementConfig,
    'production':ProductionConfig
}